<template>
  <view v-if="isShow" :style="toMessageStyle" class="toMessage">
    {{title}}
  </view>
</template>

<script>
export default {
  data() {
    return {
      x:"",
      y:"",
      title:"",
      toMessageStyle:"",
      isShow:false
    };
  },
  methods: {
    init(x,y,title){
      this.title=title
      x=parseInt(x)
      y=parseInt(y-uni.getStorageSync('menuInfo').contentTopcount)-5
      this.isShow=true
      this.toMessageStyle=`top: ${y}px;left: ${x}px;`
      setTimeout(()=>{
        this.toMessageStyle=`top: ${y-50}px;left: ${x}px;opacity: .3;`
      },100)
      setTimeout(()=>{
        this.isShow=false
      },2100)
    }
  },
}
</script>

<style lang="scss" scoped>
.toMessage{
  color: #F5A623;
  position: fixed;
  z-index: 10;
  top: 300px;
  left: 200px;
  transition: all 2s linear;
  opacity: 1;
  font-size: 34upx;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%,-50%);
}
</style>
